<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>用户权限编辑</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="__LAYUI__/layui/css/layui.css" media="all">
</head>
<body>
<form class="layui-form" action="" method="post" lay-filter="user_auth-form">
    <div class="layui-form-item">
        <div class="layui-input-inline">
            <input type="hidden" name="id" value="{$rule.id}" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">标题</label>
        <div class="layui-input-inline">
            <input type="text" name="title" value="{$rule.title}" lay-verify="required" placeholder="请输入标题"
                   autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">所属模块</label>
        <div class="layui-input-inline">
            <input type="text" name="module" value="{$rule.module}" lay-verify="required" placeholder="请输入模块名"
                   autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">父级权限</label>
            <div class="layui-input-block">
                <select name="pid" lay-filter="pid">
                    <option value="0">顶级</option>
                    {volist name="userRuleTree" id="vo"}
                    <option value="{$vo.id}" {if $rule.pid == $vo.id}selected{/if}>{$vo.title_show}</option>
                    {/volist}
                </select>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">URL</label>
        <div class="layui-input-inline">
            <input type="text" name="name" value="{$rule.name}" lay-verify="required" placeholder="请输入URL"
                   autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-inline">
            <input type="text" name="remark" value="{$rule.remark}" placeholder="请输入备注"
                   autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-inline">
            <input type="text" name="sort" value="{$rule.sort}" lay-verify="required" placeholder="请输入排序"
                   autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
            <input type="checkbox"
                   {if isset($rule.status) && $rule.status== 1}checked{elseif !isset($rule.status)}checked{else/}{/if}
            name="status" lay-skin="switch" lay-filter="switchTest" lay-text="启用|禁用">
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit lay-filter="LAY-user-front-submit" id="LAY-user-front-submit" value="确认">
    </div>
</form>

<script src="__LAYUI__/layui/layui.js"></script>
<script>
    layui.config({
        base: '__LAYUI__/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form'])
</script>
</body>
</html>